package de.elenore.system;

import android.content.Context;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.SoundPool;
import de.elenore.util.GameActivity;

public class SoundSystem {

    // TODO

    private SoundPool soundPool;
    private MediaPlayer mediaPlayer;
    private AudioManager audioManager;

    public SoundSystem(GameActivity g) {
	soundPool = new SoundPool(5, AudioManager.STREAM_MUSIC, 0);
	audioManager = (AudioManager) g.getSystemService(Context.AUDIO_SERVICE);
	g.setVolumeControlStream(AudioManager.STREAM_MUSIC);

	mediaPlayer = new MediaPlayer();

    }

    public void dispose() {
	soundPool.release();
	mediaPlayer.stop();
	mediaPlayer.release();
    }

    public int getVolume() {
	return audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
    }
}
